#pragma once 

#include <func.h>

typedef struct {
    pthread_cond_t cond;
    pthread_mutex_t mutex;
    int value;
} BSem;

// API
void bsem_init(BSem* bsem, int value);
void bsem_wait(BSem* bsem);
void bsem_post(BSem* bsem);
void bsem_postall(BSem* bsem);
void bsem_reset(BSem* bsem);
void bsem_destroy(BSem* bsem);
